* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15%;
}
.header img {
  width:130px;
  padding: 5px 15px;
  cursor: pointer;
}
ul {
  list-style-type: none;
}
.header .nav li {
  display: inline-block;
  position: relative;
  padding: 5px 15px;
}
.header .nav li a {
  display: block;
  text-decoration: none;
  padding: 10px 0;
  color: rgb(51,51,51);
}
/* 运用伪元素添加下划线 */
.nav li a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 0%;
  height: 1.5px;
  background-color: rgb(51,51,51);
  transition: all 0.25s;
}
.header .nav li a.active::after{
  left: 15%;
  width: 70%;
}
.header .nav li a:hover::after {
  left: 15%;
  width: 70%;
}